package com.billing.web.controller;


import java.io.OutputStream;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.billing.model.entity.AccountBean;
import com.billing.model.entity.TUser;
import com.billing.service.TestService;
import com.billing.utils.ExcelUtil;

@RequestMapping(value="/test")
@Controller
public class TestController {
	
	@Resource
	private TestService testService;
	
	@RequestMapping(value="/index",method=RequestMethod.GET)
	public String test(HttpServletRequest request, Model model){
		System.out.println("黑猫云车");
//		AccountBean accountBean= testService.getAccountBean(888L);
//		request.setAttribute("accountBean", accountBean);
//		request.setAttribute("abc", "后端来的abc！");
		return "index";
	}
	
	@RequestMapping(value="/login",method=RequestMethod.GET)
	public String login(HttpServletRequest request, Model model){
		System.out.println("111");
		return "login";
	}

	@RequestMapping("export")  
    public void exportInof(HttpServletRequest request,HttpServletResponse response) throws Exception{  
        response.setContentType("application/vnd.ms-excel");  
        response.setHeader("Content-Disposition", "attachment; filename=EXCELNAME.xls");  
        OutputStream out = response.getOutputStream();  
        ExcelUtil<TUser> t=new ExcelUtil<TUser>();
	}
}
